package com.controller;

import com.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

@Controller
public class StudentController {
    @RequestMapping("/student/getAllJson")
    @ResponseBody
    public List<Student> getAllJson() {
        System.out.println("11111");
        Student s1 = new Student("00001","张三",180);
        Student s2 = new Student("00002","张三33",180);
        Student s3 = new Student("00003","张三22",180);
        List<Student> students = new ArrayList<Student>();
        students.add(s1);
        students.add(s2);
        students.add(s3);
        return students;
    }
    @RequestMapping("/student/getAll")
    public ModelAndView getAll(){
        System.out.println("22222");
        return new ModelAndView("/getAll");

    }


}
